{template 'header'}
<body>
<div class="wapper">

    <section class="smal_ban">
        <div class="kidcon">
            <ul>
                <li><a href="{php echo $this->createMobileUrl('jianbaolist', array('category' => 3))}"><img src="../addons/ewei_shopping/template/mobile/res/img/kd1.png" /><a/> </li>
                <li><a href="{php echo $this->createMobileUrl('jianbaolist', array('category' => 4))}"><img src="../addons/ewei_shopping/template/mobile/res/img/kd2.png" /><a/> </li>
                <li><a href="{php echo $this->createMobileUrl('jianbaolist', array('category' => 5))}"><img src="../addons/ewei_shopping/template/mobile/res/img/kd3.png" /><a/> </li>
                <li><a href="{php echo $this->createMobileUrl('jianbaolist', array('category' => 6))}"><img src="../addons/ewei_shopping/template/mobile/res/img/kd4.png" /><a/> </li>
                <li><a href="{php echo $this->createMobileUrl('jianbaolist', array('category' => 7))}"><img src="../addons/ewei_shopping/template/mobile/res/img/kd5.png" /><a/> </li>
            </ul>
        </div>
    </section>
    <section class="zhuanjia">
        <div class="zhuanjia_list" >
            <ul id="zailist">
                {loop $goods $good}
                <li>
                    <div class="zj_le"><a href=""><img src="{$good['newthumb']}" /></a></div>
                    <div class="zj_mid">
                        <p class="tt1">{$good['title']} <img src="../addons/ewei_shopping/template/mobile/res/img/jp.png" /></p>
                        <p class="tt2">鉴宝特约专家</p>
                        <p class="tt3">擅长：{$good['catename']}</p>
                    </div>
                    <div class="zj_rg"><a href="{php echo $this->createMobileUrl('jianbaoxieyi', array('id' => $good['id']))}">请他鉴定</a></div>
                </li>
                {/loop}
                
            </ul>
            <div id="pager" style="font-size:10px;font-color:#ddd;text-align:center;height:20px" ></div>
        </div>
    </section>

{template 'footer'}
</div>

<script>
function loadPage(cur_page,page_size) {
//	pindex = parseInt(pindex) + 1;
	var pindex = cur_page;
  
    $('#pager').html('正在加载数据...');
	$.post(location.href, {'page' : pindex}, function(data){
        var jsondata = jQuery.parseJSON(data); 
        var li_clone =  "";
 
        $.each(jsondata, function(i, item) {
            
            li_clone += "<li>"
            li_clone += ' <div class="zj_le"><a href=""><img src="'+item.newthumb+'" /></a></div>'
            li_clone += '<div class="zj_mid">'
            li_clone += '<p class="tt1">'+item.title+'<img src="../addons/ewei_shopping/template/mobile/res/img/jp.png" /></p>'
            li_clone += '<p class="tt2">鉴宝特约专家</p>'
            li_clone += '<p class="tt3">擅长：'+item.catename+'</p>'
            li_clone += '</div>'
            li_clone += '<div class="zj_rg"><a href="'+item.mobileurl+'">请他鉴定</a></div>'		
            li_clone +="</li>"
            
        });
		$('#zailist').append(li_clone);
        $('#pager').html("");
	});
}

$(function(){
    var cur_page = 1;
    var page_size = 5;
    $(window).scroll(function(){
        var scrollTop = $(window).scrollTop();
        var owinH=$(window).height();
        var odocH = $(document).height();
        if(scrollTop + owinH+30 >= odocH){
            console.log(123);
            //console.log("这里是滚到底部的处理分页，这里需要你请求后台的数据！！")
            ++cur_page;
            loadPage( cur_page,page_size);
        }
         
    });
})
</script>
</body>
</html>

